﻿using Microsoft.EntityFrameworkCore;
using MySystemSetup.BusinessDomain;
using MySystemSetup.RBACDomain;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace MySystemSetup.EntityFrameworkCore;

[ConnectionStringName(MySystemSetupDbProperties.ConnectionStringName)]
public class MySystemSetupDbContext : AbpDbContext<MySystemSetupDbContext>, IMySystemSetupDbContext
{
    /* Add DbSet for each Aggregate Root here. Example:
     * public DbSet<Question> Questions { get; set; }
     */

    public DbSet<Permission> Permission { get; set; }
    public DbSet<RoleInfo> RoleInfo { get; set; }
    public DbSet<RolePermission> RolePermission { get; set; }
    public DbSet<UserInfo> UserInfo { get; set; }
    public DbSet<UserRole> UserRole { get; set; }

    public DbSet<SheepYard> SheepYard { get; set; }


    public DbSet<GiveInfo> GiveInfo { get; set; }
    public DbSet<FieldInfo> FieldInfo { get; set; }
    public DbSet<Entrepreneur> Entrepreneur { get; set; }
    public MySystemSetupDbContext(DbContextOptions<MySystemSetupDbContext> options)
        : base(options)
    {

    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        builder.ConfigureMySystemSetup();
    }
}
